<template>
	<view class="content">
		<navBack text="余额提现"></navBack>
		<view class="card_">
			<view class="money">
				<view class="">
					可提现金额
				</view>
				<view class="">
					￥{{possessMoney}}
				</view>
			</view>
			<view style="border-bottom: 2rpx solid #f5f5f5;">
				<u--input
				  placeholder="请输您要提现的金额"
				  border="surround"
				  type="digit"
				:customStyle="{padding:'28rpx 36rpx'}"
				  v-model="money"
				></u--input>
			</view>
			 
				
				<view class="hint">
					<view style="display: flex;justify-content: space-between;align-items: center;">
						<view style="color: #6a71ff;"  @click="money=possessMoney">{{possessMoney?'全部提现':''}}</view>
						 <view class="">
							提现到微信
						</view>
					</view>
					<view style="color: #ff0000;">
						{{money>possessMoney?'输入金额超过可提现余额':''}}
					</view>
				</view>	
				
				<view class="submit-btn" :style="'filter:'+(money?'grayscale(0%)':'grayscale(100%)')" @click="submit">
					提交
				</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				possessMoney:0,
				money:'',
				ratio:0
			}
		},
		computed:{
			loss(){
				return this.money*this.ratio
			}
		},
		onLoad(e) {
			// this.$myRequest('/api/system/v1/withdraw/ratio').then(res=>{
			// 	this.ratio=res.data.commission/100
				
			// })
			this.possessMoney=e.money
		},
		methods: {
			submit(){
				this.$myRequest('/api/driver/mine/v1/commission/withdrawal',{price:this.money},'POST').then(res=>{
					
				})
			},
		}
	}
</script>

<style lang="scss">
	.content{
		min-height: calc(100vh - 190rpx);
		padding: 190rpx 20rpx 0 20rpx;
		background-image: linear-gradient(to bottom,#FFCE4E , #F6F6F8 40%);
		.card_{
			background-color: #ffffff;
			border-radius: 36rpx;
			padding: 40rpx 20rpx;
			height: calc(100vh - 270rpx);
			.money{
				display: flex;
				padding: 28rpx 30rpx;
				justify-content: space-between;
				font-size: 28rpx;
				color: #ffffff;
				font-weight: bold;
				border-radius: 14rpx;
				background-color: #FFCE4E;
				margin-bottom: 44rpx;
			}
			.hint{
				font-size: 28rpx;
				color: #999999;
				text-align: right;
				view{
					margin-top: 20rpx;
				}
			}
			.submit-btn{
				width: 478rpx;
				height: 74rpx;
				background-color: #FFCE4E;
				line-height: 74rpx;
				border-radius: 37rpx;
				text-align: center;
				margin: 0 auto;
				margin-top: 100rpx;
				color: #ffffff;
			}
		}
	}

</style>
